<!DOCTYPE html>
<html>
<head>
    <title>故障类型</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 84%;
            float: right;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
    </style>
</head>
<body>
<div id="faultType" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-col span="4">
                    <i-select placeholder="模块类型" v-model="q.category">
                        <i-option v-for="item in TypeArray" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>

                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("faulttype:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("faulttype:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("faulttype:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <div style="height: 85vh;width:15%;overflow:auto;float:left;">
            <p class="text-center" style="font-size: 15px;">故障类型</p>
            <div id="storeLayer">
                <ul id="faultTree" class="ztree"></ul>
            </div>
        </div>
        <table id="faultTypeGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="faultType" :rules="ruleValidate" :label-width="80">
            <Form-item label="上级类型" prop="parentName">
                <i-input type="text" v-model="faultType.parentName" icon="md-arrow-dropdown-circle"
                         @on-click="typeTree" readonly="readonly" placeholder="上级类型"></i-input>
            </Form-item>
            <Form-item label="模块类型" prop="category">
                <i-select placeholder="模块类型" v-model="faultType.category">
                    <i-option v-for="item in TypeArray" :value="item.value" :key="item.value">{{item.name}}
                    </i-option>
                </i-select>
            </Form-item>
            <Form-item label="类型名称" prop="typeName">
                <i-input v-model="faultType.typeName" placeholder="类型名称"></i-input>
            </Form-item>
            <Form-item label="故障代码" prop="faultCode">
                <i-input v-model="faultType.faultCode" placeholder="请输入故障代码"></i-input>
            </Form-item>
            <Form-item label="备注" prop="remark">
                <i-input v-model="faultType.remark" placeholder="类型名称" type="textarea"></i-input>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<div id="faultTypeLayer" style="display: none;padding:10px;">
    <ul id="faultTypeTree" class="ztree"></ul>
</div>

<script src="${rc.contextPath}/js/sys/faulttype.js?_${date.systemTime}"></script>
</body>
</html>
